#include "relationnamelabel.h"

RelationNameLabel::RelationNameLabel()
{
    this->setZValue(10);
}

void RelationNameLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    Q_UNUSED(option);
    Q_UNUSED(widget);

    QPainterPath path;
    path.addRoundedRect(this->_boundingRect, 5, 5);

    painter->fillPath(path, this->_palette.relationNameBackground());

    painter->drawText(this->_boundingRect, this->_name, Qt::AlignHCenter | Qt::AlignVCenter);
}
